home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWExcLib / Include / FWSExcep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-08  |  3.6 KB  |  139 lines  |  [TEXT/MPS ]

  1. #ifndef FWSEXCEP_H
  2. #define FWSEXCEP_H
  3. //========================================================================================
  4. //
  5. //    File:                FWSExcep.h
  6. //    Release Version:    $ 1.0d11 $
  7. //
  8. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #include <stddef.h>
  13.  
  14. //========================================================================================
  15. //    Exception library new helper configuration
  16. //========================================================================================
  17.  
  18. //??? This define should be moved from this file into the build env or proj prefix
  19. // Also, the logic should be inverted, i.e. FW_DONT_USE_NEW_HELPER. -JEL
  20.  
  21. // [KVV] Need to disable New Helper for Visual C++ 2.0
  22. //    FW_NEW_HELPER cannot be defined on the command line because of Mac compilers (MWerks...)
  23. //    so here is another symbol which is defined when compiling Visual C++...
  24.  
  25. #ifdef FW_NATIVE_EXCEPTIONS
  26. #ifndef FW_NO_NEW_HELPER
  27. #define FW_NO_NEW_HELPER
  28. #endif
  29. #endif
  30.  
  31. #ifdef FW_NO_NEW_HELPER
  32. #ifdef FW_USE_NEW_HELPER
  33. #undef FW_USE_NEW_HELPER
  34. #endif
  35. #else
  36. #define FW_USE_NEW_HELPER
  37. #endif
  38.  
  39. //========================================================================================
  40. //    Header files
  41. //========================================================================================
  42.  
  43. #ifndef   FWCLAINF_H
  44. #include "FWClaInf.h"
  45. #endif
  46.  
  47. #if FW_LIB_EXPORT_PRAGMAS
  48. #pragma lib_export on
  49. #endif
  50.  
  51. //========================================================================================
  52. //    Forward Declarations
  53. //========================================================================================
  54.  
  55. class FW_CLASS_ATTR _FW_XException;
  56. class FW_CLASS_ATTR FW_CPrivTryBlockContext;
  57. class FW_CLASS_ATTR FW_CPrivSubHelper;
  58. class FW_CLASS_ATTR FW_CPrivDeleteEntry;
  59.  
  60. #ifdef FW_USE_NEW_HELPER
  61. class FW_CLASS_ATTR FW_CPrivNewHelper;
  62. #endif
  63.  
  64. typedef short _FW_StackEntries;
  65.  
  66. typedef void (*PFV) ();
  67.  
  68. typedef void* (*__FW_OperatorNewHandler)(size_t size);
  69. typedef void  (*__FW_OperatorDeleteHandler)(void* p);
  70.  
  71. //========================================================================================
  72. //    STRUCT FW_SPrivExceptionGlobals
  73. //
  74. //        Globals for exception handling system.
  75. //        Only one instance of this struct will be instantiated per task.
  76. //
  77. //========================================================================================
  78.  
  79. #ifdef FW_BUILD_MAC
  80. #pragma options align=mac68k
  81. #endif
  82.  
  83. #ifdef FW_BUILD_WIN
  84. #pragma pack(push, 1)
  85. #endif
  86.  
  87. struct FW_SPrivExceptionGlobals
  88. {
  89.     short                         gInitialized;
  90.  
  91. #ifndef FW_NATIVE_EXCEPTIONS
  92.  
  93.     FW_CPrivTryBlockContext*        gBaseContext;
  94.     FW_CPrivTryBlockContext*        gCurrentContext;
  95.     short                         gContextDepth;
  96.  
  97.     _FW_StackEntries            gCurrentStackSize;
  98.     FW_CPrivDeleteEntry*            gStackBase;
  99.     FW_CPrivDeleteEntry*            gStackTop;
  100.     FW_CPrivDeleteEntry*            gStackLimit;
  101.  
  102.     long                        gExceptionBufferSize;
  103.     void*                        gExceptionBuffer;
  104.     _FW_XException*                gCaughtException;
  105.     _FW_XException*                gThrownException;
  106.     short                        gIsThrowing;
  107.     
  108.     PFV                            gCurrentTerminate;
  109.     PFV                            gCurrentUnexpected;
  110.     
  111.     FW_ClassInfoPtr             gBreakExceptionKind;
  112.     
  113. #ifdef FW_USE_NEW_HELPER
  114.     FW_CPrivNewHelper**        gNewHelperStackBottom;
  115.     FW_CPrivNewHelper**        gNewHelperStackTop;
  116.     FW_CPrivSubHelper*            gSubHelperStorageArray;
  117.     FW_CPrivSubHelper*            gSubHelperFreeListHead;
  118. #endif
  119.  
  120. #endif // FW_NATIVE_EXCEPTIONS
  121.  
  122.     __FW_OperatorNewHandler        gOperatorNewHandler;
  123.     __FW_OperatorDeleteHandler    gOperatorDeleteHandler;
  124. };
  125.  
  126. #ifdef FW_BUILD_MAC
  127. #pragma options align=reset
  128. #endif
  129.  
  130. #ifdef FW_BUILD_WIN
  131. #pragma pack(pop)
  132. #endif
  133.  
  134. #if FW_LIB_EXPORT_PRAGMAS
  135. #pragma lib_export off
  136. #endif
  137.  
  138. #endif
  139.